package com.ncloud.chnl.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ncloud.chnl.service.ChnlService;

@RestController
@RequestMapping
public class ChnlController {
	
	@Autowired
	private ChnlService service;
	
	@RequestMapping(value="allChnl")
	public Object getAllChnl(String param1){
		JSONObject json = new JSONObject();
		json.put("userID", "1");
//		json.put("pageSize", "2");
//		json.put("pageNum", "1");
		Object array = service.getChnlList(json);
		System.out.println(array.toString());
		return array;
	}
	
	@RequestMapping(value="getChnl")
	public JSONObject getChnl(Long chnlId){
		JSONObject array = service.getChnl(JSON.parseObject("{chnlId:"+chnlId+"}"));
		return array;
	}
}
